import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.Month;
import java.util.Date;
import java.util.Locale;
import java.util.SimpleTimeZone;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {
    public static void main(String[] args) throws ParseException {
//        System.out.println("hello world");

/*        String qq = "123456789";
        System.out.println(checkQQ(qq));


        qq.matches("[1-9]\\d{5,19}");
    }

//    假如现在要求校验一个qq号码是否正确。规则:6位及20位之内，8不能在开头，必须全部是数字先使用目前所学知识完成校验需求然后体验一下正则表达式检验。/
public static boolean checkQQ(String qq){
        if(qq.length() < 6 || qq.length() > 20){
            return false;
        }
        if(qq.startsWith("8")){
            return false;
        }
        for(int i = 0; i < qq.length(); i++){
            char c = qq.charAt(i);
            if(c < '0' || c > '9')
                return false;
         }
    return true;*/




/*        String regex1 = "1[3-9]\\d{9}";
        System.out.println("19626261615".matches(regex1));
        System.out.println("13555654552".matches(regex1));
        System.out.println("10633332665".matches(regex1));
        System.out.println("1234567890a".matches(regex1));
        System.out.println("15896565547".matches(regex1));
        System.out.println("-----------------------------");*/





/*        String regex2 ="0\\d{2,3}-{0,1}[1-9]\\d{4,9}";
        System.out.println("010-12345678".matches(regex2));
        System.out.println("0531-1234567".matches(regex2));
        System.out.println("0531-123456789".matches(regex2));
        System.out.println("0531-123456".matches(regex2));
        System.out.println("0531-123456789".matches(regex2));
        System.out.println("01212345678".matches(regex2));
        System.out.println("0123-1234567".matches(regex2));*/

     /*   String regex3 = "\\w+@[\\w&&[^_]]{2,6}(\\.[a-zA-Z]{2,3}){1,2}";
        System.out.println("zhangsan@sina.com.cn".matches(regex3));
        System.out.println("zhangsan@sina.com".matches(regex3));
        System.out.println("zhangsan@163.com".matches(regex3));
        System.out.println("z5859@163.com.cn".matches(regex3));
        System.out.println("zhangsan@163.com.com".matches(regex3));
        System.out.println("zhangsan@163.c".matches(regex3));
        System.out.println("22222222@qq.com".matches(regex3));*/



/*        String regex4 ="(?:[01]\\d|2[0-3])(:[0-5]\\d){2}";
        System.out.println("23:59:59".matches(regex4));
        System.out.println("23:59:60".matches(regex4));
        System.out.println("23:60:59".matches(regex4));
        System.out.println("24:59:59".matches(regex4));*/



      /*  String regex5="[1-9]\\d{5}(?:18|19|20)\\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\\d|30|31)\\d{3}[\\dXx]";
        System.out.println("110105199003077463".matches(regex5));
        System.out.println("11010519900307746X".matches(regex5));
        System.out.println("11010519900307746x".matches(regex5));
        System.out.println("110105199003077462".matches(regex5));*/
/*
        Pattern p = Pattern.compile("java\\d{0,2}");
        Matcher m = p.matcher("javajava123");
        while (m.find()){
            System.out.println(m.group());
        }*/


/*        Date date = new Date();
        System.out.println(date);

        Date date1 = new Date(100000);
        System.out.println(date1);

        date1.setTime(1000);
        System.out.println(date1);

        long time = date1.getTime();
        System.out.println(time);*/



/*
        Date d1 = new Date(0);
        long time = d1.getTime();
        time = time + 1000L*60*60*24*365;
        d1.setTime(time);
        System.out.println(d1);*/



/*        String str = "2023-11-11 11:11:11";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date data  = sdf.parse(str);
        System.out.println(data);
        System.out.println(data.getTime());

        extracted();

    }

    private static void extracted() {
        SimpleDateFormat sdf  = new SimpleDateFormat();
        Date d = new Date(0L);
        String str = sdf.format(d);
        System.out.println(str);

        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        String str2 = sdf2.format(d);
        System.out.println(str2);

        SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss E");
        String str3 = sdf3.format(d);
        System.out.println(str3);
    }*/


/*        String str = "2000-11-11";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date = sdf.parse(str);
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd日");
        String result = sdf2.format(date);
        System.out.println(result);*/


/*        String startstr = "2023年11月11日 0:0:0";
        String endstr = "2023年11月11日 0:10:0";
        String orderStr = "2023年11月11日 0:01:00";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        Date startData = sdf.parse(startstr);
        Date endData = sdf.parse(endstr);
        Date orderData = sdf.parse(orderStr);

        long starttime = startData.getTime();
        long endtime = endData.getTime();
        long orderTime = orderData.getTime();

        if (starttime <= orderTime && orderTime <= endtime) {
            System.out.println("可以下单");

        } else {
            System.out.println("不可以下单");
        }*/

/*        LocalDate nowData = LocalDate.now();
        System.out.println("当前日期："+nowData);
        LocalDate ldData  = LocalDate.of(2023,1,1);
        System.out.println("指定日期："+ldData);
        int year = ldData.getYear();
        System.out.println("年："+year);
        int month = ldData.getMonthValue();
        System.out.println("月："+month);
        Month month1 = ldData.getMonth();
        System.out.println("月："+month1);
        System.out.println(month1.getValue());
        int day = ldData.getDayOfMonth();
        System.out.println("日："+day);
        int dayofweek = ldData.getDayOfWeek().getValue();
        System.out.println("星期："+dayofweek);
        int dayofyear = ldData.getDayOfYear();
        System.out.println("一年中的第几天："+dayofyear);
        System.out.println("当前日期是闰年吗？"+ldData.isLeapYear());
        System.out.println("当前日期是本月的第一天吗？"+ldData.getDayOfMonth());
        System.out.println("当前日期是本月的最后一天吗？"+ldData.getDayOfMonth());
        System.out.println("当前日期是本年的最后一天吗？"+ldData.getDayOfYear());
        System.out.println("当前日期是本年的第一天吗？"+ldData.getDayOfYear());
        System.out.println("当前日期是本月的最后一天吗？"+ldData.lengthOfMonth());
        System.out.println(ldData.isAfter(ldData));*/


        String str1 = Integer.toBinaryString(100);
        System.out.println(str1);
        String str2 = Integer.toOctalString(100);
        System.out.println(str2);
        String str3 = Integer.toHexString(100);
        System.out.println(str3);
        int  i = Integer.parseInt("123");
        System.out.println(i);
        System.out.println(i+1);

    }
}
